<?php
/**
 * 操作日志模块
 * UserModel:LLW
 * Date:2020-03-03
 */

namespace app\caidongweb\model;

class LogsModel extends BaseModel
{
    protected $table = 'cd_logs';

    public function getUserList()
    {
        $where = [];
        $stae = strtotime(input('start'));
        $end = strtotime(input('end'));
        if($stae && $end){
            $where['lo_time'] = array('between',"$stae,$end");
        }
        input('type') ? $where['lo_type'] = input('type') : false;
        input('style') ? $where['lo_style'] = input('style') : false;
        input('key') ? $where[input('city')] = input('key') : false;
        $list = $this->where($where)->order('lo_time desc')->paginate(50,false,['query'=>request()->param()]);
        return $list;
    }
}